
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta charset="utf-8" />
    <title>Introduction to atomman: LAMMPS data file conversions &#8212; atomman 1.4.0 documentation</title>
    <link rel="stylesheet" href="../_static/basic.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/language_data.js"></script>
    <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
    <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["$", "$"], ["\\(", "\\)"]], "processEscapes": true, "ignoreClass": "document", "processClass": "math|output_area"}})</script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Introduction to atomman: LAMMPS dump file conversions" href="1.4.6._LAMMPS_dump_file_conversions.html" />
    <link rel="prev" title="Introduction to atomman: table conversions" href="1.4.4._table_conversions.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="1.4.6._LAMMPS_dump_file_conversions.html" title="Introduction to atomman: LAMMPS dump file conversions"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="1.4.4._table_conversions.html" title="Introduction to atomman: table conversions"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">atomman 1.4.0 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Tutorials</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  
<style>
/* CSS for nbsphinx extension */

/* remove conflicting styling from Sphinx themes */
div.nbinput.container div.prompt *,
div.nboutput.container div.prompt *,
div.nbinput.container div.input_area pre,
div.nboutput.container div.output_area pre,
div.nbinput.container div.input_area .highlight,
div.nboutput.container div.output_area .highlight {
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

div.nbinput.container > div[class*=highlight],
div.nboutput.container > div[class*=highlight] {
    margin: 0;
}

div.nbinput.container div.prompt *,
div.nboutput.container div.prompt * {
    background: none;
}

div.nboutput.container div.output_area .highlight,
div.nboutput.container div.output_area pre {
    background: unset;
}

div.nboutput.container div.output_area div.highlight {
    color: unset;  /* override Pygments text color */
}

/* avoid gaps between output lines */
div.nboutput.container div[class*=highlight] pre {
    line-height: normal;
}

/* input/output containers */
div.nbinput.container,
div.nboutput.container {
    display: -webkit-flex;
    display: flex;
    align-items: flex-start;
    margin: 0;
    width: 100%;
}
@media (max-width: 540px) {
    div.nbinput.container,
    div.nboutput.container {
        flex-direction: column;
    }
}

/* input container */
div.nbinput.container {
    padding-top: 5px;
}

/* last container */
div.nblast.container {
    padding-bottom: 5px;
}

/* input prompt */
div.nbinput.container div.prompt pre {
    color: #307FC1;
}

/* output prompt */
div.nboutput.container div.prompt pre {
    color: #BF5B3D;
}

/* all prompts */
div.nbinput.container div.prompt,
div.nboutput.container div.prompt {
    width: 4.5ex;
    padding-top: 5px;
    position: relative;
    user-select: none;
}

div.nbinput.container div.prompt > div,
div.nboutput.container div.prompt > div {
    position: absolute;
    right: 0;
    margin-right: 0.3ex;
}

@media (max-width: 540px) {
    div.nbinput.container div.prompt,
    div.nboutput.container div.prompt {
        width: unset;
        text-align: left;
        padding: 0.4em;
    }
    div.nboutput.container div.prompt.empty {
        padding: 0;
    }

    div.nbinput.container div.prompt > div,
    div.nboutput.container div.prompt > div {
        position: unset;
    }
}

/* disable scrollbars on prompts */
div.nbinput.container div.prompt pre,
div.nboutput.container div.prompt pre {
    overflow: hidden;
}

/* input/output area */
div.nbinput.container div.input_area,
div.nboutput.container div.output_area {
    -webkit-flex: 1;
    flex: 1;
    overflow: auto;
}
@media (max-width: 540px) {
    div.nbinput.container div.input_area,
    div.nboutput.container div.output_area {
        width: 100%;
    }
}

/* input area */
div.nbinput.container div.input_area {
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    /*background: #f5f5f5;*/
}

/* override MathJax center alignment in output cells */
div.nboutput.container div[class*=MathJax] {
    text-align: left !important;
}

/* override sphinx.ext.imgmath center alignment in output cells */
div.nboutput.container div.math p {
    text-align: left;
}

/* standard error */
div.nboutput.container div.output_area.stderr {
    background: #fdd;
}

/* ANSI colors */
.ansi-black-fg { color: #3E424D; }
.ansi-black-bg { background-color: #3E424D; }
.ansi-black-intense-fg { color: #282C36; }
.ansi-black-intense-bg { background-color: #282C36; }
.ansi-red-fg { color: #E75C58; }
.ansi-red-bg { background-color: #E75C58; }
.ansi-red-intense-fg { color: #B22B31; }
.ansi-red-intense-bg { background-color: #B22B31; }
.ansi-green-fg { color: #00A250; }
.ansi-green-bg { background-color: #00A250; }
.ansi-green-intense-fg { color: #007427; }
.ansi-green-intense-bg { background-color: #007427; }
.ansi-yellow-fg { color: #DDB62B; }
.ansi-yellow-bg { background-color: #DDB62B; }
.ansi-yellow-intense-fg { color: #B27D12; }
.ansi-yellow-intense-bg { background-color: #B27D12; }
.ansi-blue-fg { color: #208FFB; }
.ansi-blue-bg { background-color: #208FFB; }
.ansi-blue-intense-fg { color: #0065CA; }
.ansi-blue-intense-bg { background-color: #0065CA; }
.ansi-magenta-fg { color: #D160C4; }
.ansi-magenta-bg { background-color: #D160C4; }
.ansi-magenta-intense-fg { color: #A03196; }
.ansi-magenta-intense-bg { background-color: #A03196; }
.ansi-cyan-fg { color: #60C6C8; }
.ansi-cyan-bg { background-color: #60C6C8; }
.ansi-cyan-intense-fg { color: #258F8F; }
.ansi-cyan-intense-bg { background-color: #258F8F; }
.ansi-white-fg { color: #C5C1B4; }
.ansi-white-bg { background-color: #C5C1B4; }
.ansi-white-intense-fg { color: #A1A6B2; }
.ansi-white-intense-bg { background-color: #A1A6B2; }

.ansi-default-inverse-fg { color: #FFFFFF; }
.ansi-default-inverse-bg { background-color: #000000; }

.ansi-bold { font-weight: bold; }
.ansi-underline { text-decoration: underline; }


div.nbinput.container div.input_area div[class*=highlight] > pre,
div.nboutput.container div.output_area div[class*=highlight] > pre,
div.nboutput.container div.output_area div[class*=highlight].math,
div.nboutput.container div.output_area.rendered_html,
div.nboutput.container div.output_area > div.output_javascript,
div.nboutput.container div.output_area:not(.rendered_html) > img{
    padding: 5px;
    margin: 0;
}

/* fix copybtn overflow problem in chromium (needed for 'sphinx_copybutton') */
div.nbinput.container div.input_area > div[class^='highlight'],
div.nboutput.container div.output_area > div[class^='highlight']{
    overflow-y: hidden;
}

/* hide copybtn icon on prompts (needed for 'sphinx_copybutton') */
.prompt a.copybtn {
    display: none;
}

/* Some additional styling taken form the Jupyter notebook CSS */
div.rendered_html table {
  border: none;
  border-collapse: collapse;
  border-spacing: 0;
  color: black;
  font-size: 12px;
  table-layout: fixed;
}
div.rendered_html thead {
  border-bottom: 1px solid black;
  vertical-align: bottom;
}
div.rendered_html tr,
div.rendered_html th,
div.rendered_html td {
  text-align: right;
  vertical-align: middle;
  padding: 0.5em 0.5em;
  line-height: normal;
  white-space: normal;
  max-width: none;
  border: none;
}
div.rendered_html th {
  font-weight: bold;
}
div.rendered_html tbody tr:nth-child(odd) {
  background: #f5f5f5;
}
div.rendered_html tbody tr:hover {
  background: rgba(66, 165, 245, 0.2);
}
</style>
<div class="section" id="Introduction-to-atomman:-LAMMPS-data-file-conversions">
<h1>Introduction to atomman: LAMMPS data file conversions<a class="headerlink" href="#Introduction-to-atomman:-LAMMPS-data-file-conversions" title="Permalink to this headline">¶</a></h1>
<p><strong>Lucas M. Hale</strong>, <a class="reference external" href="mailto:lucas&#46;hale&#37;&#52;&#48;nist&#46;gov?Subject=ipr-demo">lucas<span>&#46;</span>hale<span>&#64;</span>nist<span>&#46;</span>gov</a>, <em>Materials Science and Engineering Division, NIST</em>.</p>
<p><a class="reference external" href="http://www.nist.gov/public_affairs/disclaimer.cfm">Disclaimers</a></p>
<div class="section" id="1.-Introduction">
<h2>1. Introduction<a class="headerlink" href="#1.-Introduction" title="Permalink to this headline">¶</a></h2>
<p>The atom_data format is the atomic data files used by LAMMPS for importing initial configurations. Currently, atomman offers partial support for the atom_data format based on atomman’s core features. See the <a class="reference external" href="https://lammps.sandia.gov/doc/read_data.html">LAMMPS documentation</a> for more details on the format.</p>
<p>The supported atom_data fields are</p>
<ul class="simple">
<li><p>Header sections:</p>
<ul>
<li><p><strong>atoms</strong>: number of atoms. Required during load, always listed during dump.</p></li>
<li><p><strong>atom types</strong>: number of atom types. Required during load if Masses is included, always listed during dump.</p></li>
<li><p><strong>xlo xhi</strong>: simulation box boundaries in x dimension. Required during load, always listed during dump.</p></li>
<li><p><strong>ylo yhi</strong>: simulation box boundaries in y dimension. Required during load, always listed during dump.</p></li>
<li><p><strong>zlo zhi</strong>: simulation box boundaries in z dimension. Required during load, always listed during dump.</p></li>
<li><p><strong>xy xz yz</strong>: simulation box tilt factors for triclinic system. Optional during load, listed during dump only if the tilt factors have non-zero values.</p></li>
</ul>
</li>
<li><p>Body sections:</p>
<ul>
<li><p><strong>Atoms</strong>: lists per-atom properties associated with each atom. The mapping of LAMMPS&lt;-&gt;atomman representations of the per-atom properties can be found in atomman.load.atom_data.atoms_prop_info and atomman.dump.atom_data.atoms_prop_info. Required during load, always listed during dump.</p></li>
<li><p><strong>Velocities</strong>: list per-atom velocity properties associated with each atom. The mapping of LAMMPS&lt;-&gt;atomman representations of the per-atom properties can be found in atomman.load.atom_data.velocities_prop_info and atomman.dump.atom_data.velocities_prop_info. Optional during load, will be listed during dump if ‘velocity’ is set as a per-atom property.</p></li>
<li><p><strong>Masses</strong>: masses per each atom type. Optional during load, where values are saved to system.masses. As for dump, the Masses section is never included because atomman.lammps.Potential generates LAMMPS mass input command lines. See Section 3.4 below for more details.</p></li>
</ul>
</li>
</ul>
<p>Notes on ignored fields:</p>
<ul class="simple">
<li><p>The <strong>Pair Coeffs</strong> and <strong>PairIJ Coeffs</strong> fields are ignored as potential parameters are handled with the atomman.lammps.Potential class.</p></li>
<li><p>Support for <strong>bonds, angles, dihedrals, impropers, ellipsoids, lines, triangles,</strong> and <strong>bodies</strong> would require defining how to represent these as objects in atomman. Extending support is possible, but only if there is enough interest and help from experts of these data types.</p></li>
</ul>
<p><strong>Library Imports</strong></p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[1]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Standard Python libraries</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">datetime</span>

<span class="c1"># http://www.numpy.org/</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>

<span class="kn">import</span> <span class="nn">atomman</span> <span class="k">as</span> <span class="nn">am</span>
<span class="kn">import</span> <span class="nn">atomman.lammps</span> <span class="k">as</span> <span class="nn">lmp</span>
<span class="kn">import</span> <span class="nn">atomman.unitconvert</span> <span class="k">as</span> <span class="nn">uc</span>

<span class="c1"># Show atomman version</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;atomman version =&#39;</span><span class="p">,</span> <span class="n">am</span><span class="o">.</span><span class="n">__version__</span><span class="p">)</span>

<span class="c1"># Show date of Notebook execution</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;Notebook executed on&#39;</span><span class="p">,</span> <span class="n">datetime</span><span class="o">.</span><span class="n">date</span><span class="o">.</span><span class="n">today</span><span class="p">())</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
atomman version = 1.4.0
Notebook executed on 2021-08-04
</pre></div></div>
</div>
</div>
<div class="section" id="2.-atomman.load(‘atom_data’)">
<h2>2. atomman.load(‘atom_data’)<a class="headerlink" href="#2.-atomman.load(‘atom_data’)" title="Permalink to this headline">¶</a></h2>
<p><em>Update version 1.3.0</em>: Support for image flags, Masses, and atom_style values listed in the data file are added. Errors returned by the method are updated to be more meaningful.</p>
<p>Parameters</p>
<ul class="simple">
<li><p><strong>data</strong> (<em>str or file-like object</em>) The atom data content to read. Can be str content, path name, or open file-like object.</p></li>
<li><p><strong>pbc</strong> (<em>list of bool</em>) Three boolean values indicating which System directions are periodic. Default value is (True, True, True).</p></li>
<li><p><strong>symbols</strong> (<em>tuple, optional</em>) Allows the list of element symbols to be assigned during loading.</p></li>
<li><p><strong>atom_style</strong> (<em>str, optional</em>) The LAMMPS atom_style option associated with the data file. Optional as the data can list this value in a comment in the Atoms section header. If not given and not found in data, the default value of ‘atomic’ is used.</p></li>
<li><p><strong>units</strong> (<em>str, optional</em>) The LAMMPS units option associated with the data file. Default value is ‘metal’.</p></li>
</ul>
<p>Returns</p>
<ul class="simple">
<li><p>(<em>atomman.System</em>) The corresponding system. Note all property values will be automatically converted to atomman.unitconvert’s working units.</p></li>
</ul>
<p>Raises</p>
<ul class="simple">
<li><p>(<em>FileNotFoundError</em>) If data is (likely) a file name and no matching file is found.</p></li>
<li><p>(<em>FileFormatError</em>) If required content fields not found.</p></li>
<li><p>(<em>ValueError</em>) If atom_style is both given as a parameter and found in data, but are not the same</p></li>
</ul>
<div class="section" id="2.1.-Basic-example">
<h3>2.1. Basic example<a class="headerlink" href="#2.1.-Basic-example" title="Permalink to this headline">¶</a></h3>
<p>bcc Fe unit cell without masses and default atom_style=‘atomic’ assumed.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[2]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="n">bccFe</span> <span class="o">=</span> <span class="s2">&quot;&quot;&quot;</span>
<span class="s2">2 atoms</span>
<span class="s2">1 atom types</span>
<span class="s2">0.0000000000000 2.8665000000000 xlo xhi</span>
<span class="s2">0.0000000000000 2.8665000000000 ylo yhi</span>
<span class="s2">0.0000000000000 2.8665000000000 zlo zhi</span>

<span class="s2">Masses</span>

<span class="s2">1 55.845</span>

<span class="s2">Atoms</span>

<span class="s2">1 1 0.0000000000000 0.0000000000000 0.0000000000000</span>
<span class="s2">2 1 1.4332500000000 1.4332500000000 1.4332500000000</span>
<span class="s2">&quot;&quot;&quot;</span>

<span class="c1"># Symbols specified here as file format does not include them</span>
<span class="n">system</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="s1">&#39;atom_data&#39;</span><span class="p">,</span> <span class="n">bccFe</span><span class="p">,</span> <span class="n">symbols</span><span class="o">=</span><span class="s1">&#39;Fe&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [ 2.866,  0.000,  0.000]
bvect =  [ 0.000,  2.866,  0.000]
cvect =  [ 0.000,  0.000,  2.866]
origin = [ 0.000,  0.000,  0.000]
natoms = 2
natypes = 1
symbols = (&#39;Fe&#39;,)
pbc = [ True  True  True]
per-atom properties = [&#39;atype&#39;, &#39;pos&#39;]
     id |   atype |  pos[0] |  pos[1] |  pos[2]
      0 |       1 |   0.000 |   0.000 |   0.000
      1 |       1 |   1.433 |   1.433 |   1.433
</pre></div></div>
</div>
<p>Here, Masses were listed in the file and are saved to system.masses. If the Masses section was not included, all system.masses values would be None.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[3]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="nb">print</span><span class="p">(</span><span class="s1">&#39;masses =&#39;</span><span class="p">,</span><span class="n">system</span><span class="o">.</span><span class="n">masses</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
masses = (55.845,)
</pre></div></div>
</div>
</div>
<div class="section" id="2.2.-Different-atom_styles">
<h3>2.2. Different atom_styles<a class="headerlink" href="#2.2.-Different-atom_styles" title="Permalink to this headline">¶</a></h3>
<p>Files that use atom_style formats different from ‘atomic’ can be read if either the atom_style parameter is specified or if the atom_style is listed as a comment after the “Atoms” header line in the data.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[4]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Example 1 for atom_style charge</span>
<span class="n">bccFe</span> <span class="o">=</span> <span class="s2">&quot;&quot;&quot;</span>
<span class="s2">2 atoms</span>
<span class="s2">1 atom types</span>
<span class="s2">0.0000000000000 2.8665000000000 xlo xhi</span>
<span class="s2">0.0000000000000 2.8665000000000 ylo yhi</span>
<span class="s2">0.0000000000000 2.8665000000000 zlo zhi</span>

<span class="s2">Masses</span>

<span class="s2">1 55.845</span>

<span class="s2">Atoms # charge</span>

<span class="s2">1 1 0.0000000000000 0.0000000000000 0.0000000000000 0.0000000000000</span>
<span class="s2">2 1 0.0000000000000 1.4332500000000 1.4332500000000 1.4332500000000</span>
<span class="s2">&quot;&quot;&quot;</span>

<span class="c1"># atom_style not needed as &#39;charge&#39; is specified in the data</span>
<span class="n">system</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="s1">&#39;atom_data&#39;</span><span class="p">,</span> <span class="n">bccFe</span><span class="p">,</span> <span class="n">symbols</span><span class="o">=</span><span class="s1">&#39;Fe&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="p">)</span>

<span class="c1"># Show that charges are set</span>
<span class="nb">print</span><span class="p">()</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;system.atoms.charge =&#39;</span><span class="p">,</span><span class="n">system</span><span class="o">.</span><span class="n">atoms</span><span class="o">.</span><span class="n">charge</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [ 2.866,  0.000,  0.000]
bvect =  [ 0.000,  2.866,  0.000]
cvect =  [ 0.000,  0.000,  2.866]
origin = [ 0.000,  0.000,  0.000]
natoms = 2
natypes = 1
symbols = (&#39;Fe&#39;,)
pbc = [ True  True  True]
per-atom properties = [&#39;atype&#39;, &#39;pos&#39;, &#39;charge&#39;]
     id |   atype |  pos[0] |  pos[1] |  pos[2]
      0 |       1 |   0.000 |   0.000 |   0.000
      1 |       1 |   1.433 |   1.433 |   1.433

system.atoms.charge = [0. 0.]
</pre></div></div>
</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[5]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Example 2 for atom_style charge (no comment in data)</span>
<span class="n">bccFe</span> <span class="o">=</span> <span class="s2">&quot;&quot;&quot;</span>
<span class="s2">2 atoms</span>
<span class="s2">1 atom types</span>
<span class="s2">0.0000000000000 2.8665000000000 xlo xhi</span>
<span class="s2">0.0000000000000 2.8665000000000 ylo yhi</span>
<span class="s2">0.0000000000000 2.8665000000000 zlo zhi</span>

<span class="s2">Masses</span>

<span class="s2">1 55.845</span>

<span class="s2">Atoms</span>

<span class="s2">1 1 0.0000000000000 0.0000000000000 0.0000000000000 0.0000000000000</span>
<span class="s2">2 1 0.0000000000000 1.4332500000000 1.4332500000000 1.4332500000000</span>
<span class="s2">&quot;&quot;&quot;</span>

<span class="c1"># atom_style=&#39;charge&#39; required</span>
<span class="n">system</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="s1">&#39;atom_data&#39;</span><span class="p">,</span> <span class="n">bccFe</span><span class="p">,</span> <span class="n">symbols</span><span class="o">=</span><span class="s1">&#39;Fe&#39;</span><span class="p">,</span> <span class="n">atom_style</span><span class="o">=</span><span class="s1">&#39;charge&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="p">)</span>

<span class="c1"># Show that charges are set</span>
<span class="nb">print</span><span class="p">()</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;system.atoms.charge =&#39;</span><span class="p">,</span><span class="n">system</span><span class="o">.</span><span class="n">atoms</span><span class="o">.</span><span class="n">charge</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [ 2.866,  0.000,  0.000]
bvect =  [ 0.000,  2.866,  0.000]
cvect =  [ 0.000,  0.000,  2.866]
origin = [ 0.000,  0.000,  0.000]
natoms = 2
natypes = 1
symbols = (&#39;Fe&#39;,)
pbc = [ True  True  True]
per-atom properties = [&#39;atype&#39;, &#39;pos&#39;, &#39;charge&#39;]
     id |   atype |  pos[0] |  pos[1] |  pos[2]
      0 |       1 |   0.000 |   0.000 |   0.000
      1 |       1 |   1.433 |   1.433 |   1.433

system.atoms.charge = [0. 0.]
</pre></div></div>
</div>
</div>
<div class="section" id="2.3.-Image-flag-handling">
<h3>2.3. Image flag handling<a class="headerlink" href="#2.3.-Image-flag-handling" title="Permalink to this headline">¶</a></h3>
<p>Integer image flags can be added to Atoms table to move atoms to periodic replicas</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[6]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="n">bccFe</span> <span class="o">=</span> <span class="s2">&quot;&quot;&quot;</span>
<span class="s2">2 atoms</span>
<span class="s2">1 atom types</span>
<span class="s2">0.0000000000000 2.8665000000000 xlo xhi</span>
<span class="s2">0.0000000000000 2.8665000000000 ylo yhi</span>
<span class="s2">0.0000000000000 2.8665000000000 zlo zhi</span>

<span class="s2">Masses</span>

<span class="s2">1 55.845</span>

<span class="s2">Atoms</span>

<span class="s2">1 1 0.0000000000000 0.0000000000000 0.0000000000000 0 0 0</span>
<span class="s2">2 1 1.4332500000000 1.4332500000000 1.4332500000000 1 0 0</span>
<span class="s2">&quot;&quot;&quot;</span>

<span class="c1"># Symbols specified here as file format</span>
<span class="n">system</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="s1">&#39;atom_data&#39;</span><span class="p">,</span> <span class="n">bccFe</span><span class="p">,</span> <span class="n">symbols</span><span class="o">=</span><span class="s1">&#39;Fe&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">system</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
avect =  [ 2.866,  0.000,  0.000]
bvect =  [ 0.000,  2.866,  0.000]
cvect =  [ 0.000,  0.000,  2.866]
origin = [ 0.000,  0.000,  0.000]
natoms = 2
natypes = 1
symbols = (&#39;Fe&#39;,)
pbc = [ True  True  True]
per-atom properties = [&#39;atype&#39;, &#39;pos&#39;]
     id |   atype |  pos[0] |  pos[1] |  pos[2]
      0 |       1 |   0.000 |   0.000 |   0.000
      1 |       1 |   4.300 |   1.433 |   1.433
</pre></div></div>
</div>
</div>
</div>
<div class="section" id="3.-System.dump(‘atom_data’)">
<h2>3. System.dump(‘atom_data’)<a class="headerlink" href="#3.-System.dump(‘atom_data’)" title="Permalink to this headline">¶</a></h2>
<p><em>Updated version 1.3.0</em>: Parameters natypes, potential, and return_pair_info are added to provide better integration and compatibility across potentials with different pair_styles.</p>
<p><em>Updated version 1.4.0</em>: The return_pair_info parameter has been removed and potential commands are included in the returned info simply if potential is given.</p>
<p>Parameters</p>
<ul class="simple">
<li><p><strong>f</strong> (<em>str or file-like object, optional</em>) File path or file-like object to write the content to. If not given, then the content is returned as a str.</p></li>
<li><p><strong>atom_style</strong> (<em>str, optional</em>) The LAMMPS atom_style option associated with the data file. If neither atom_style or potential is given, will set atom_style to ‘atomic’.</p></li>
<li><p><strong>units</strong> (<em>str, optional</em>) The LAMMPS units option associated with the data file. If neitherunits or potential is given, will set units ‘metal’.</p></li>
<li><p><strong>natypes</strong> (<em>int, optional</em>) Allows the natypes value to be manually changed. This is needed if natypes needs to be greater than the current number of atypes. If neither natypes or potential is given, will use system.natypes.</p></li>
<li><p><strong>potential</strong> (<em>atomman.lammps.Potential, optional</em>) Potential-specific values of atom_style, units, and natypes can be extracted from a Potential object. If both potential and any of the individual values are given, the individual values will be used.</p></li>
<li><p><strong>float_format</strong> (<em>str, optional</em>) c-style formatting string for floating point values. Default value is ‘%.13f’.</p></li>
<li><p><strong>return_info</strong> (<em>bool, optional</em>) Indicates if the LAMMPS command lines associated with reading in the file are to be returned as a str. If potential is given, then the commands associated with the potential will be included. Default value is True.</p></li>
<li><p><strong>safecopy</strong> (<em>bool, optional</em>) The LAMMPS data format requires all atoms to be inside box bounds, i.e. “wrapped”. If safecopy is True then a copy of the system is made to keep the original unwrapped. Default value is False.</p></li>
</ul>
<p>Returns</p>
<ul class="simple">
<li><p><strong>content</strong> (<em>str, optional</em>) The data file contents. Returned if f is not given.</p></li>
<li><p><strong>read_info</strong> (<em>str, optional</em>) The LAMMPS input command lines to read the created data file in. Returned if return_info is True. If return_pair_info is also True and potential is given, the LAMMPS input command lines for the potential are also included.</p></li>
</ul>
<p>Raises</p>
<ul class="simple">
<li><p>(<em>ValueError</em>) If return_pair_info is True and return_info is False or potential is not given.</p></li>
</ul>
<div class="section" id="3.1.-Basic-example">
<h3>3.1. Basic example<a class="headerlink" href="#3.1.-Basic-example" title="Permalink to this headline">¶</a></h3>
<p>Show dump by loading a simple data file, then dumping it to a file.</p>
<p><strong>NOTE:</strong> It is highly recommended that the potential be given (Section 3.3.) if you are using the generated LAMMPS command lines. Doing so ensures the proper options and order of command lines across all native LAMMPS and OpenKIM potentials currently in the NIST database.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[7]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="n">bccFe</span> <span class="o">=</span> <span class="s2">&quot;&quot;&quot;</span>
<span class="s2">2 atoms</span>
<span class="s2">1 atom types</span>
<span class="s2">0.0000000000000 2.8665000000000 xlo xhi</span>
<span class="s2">0.0000000000000 2.8665000000000 ylo yhi</span>
<span class="s2">0.0000000000000 2.8665000000000 zlo zhi</span>

<span class="s2">Atoms</span>

<span class="s2">1 1 0.0000000000000 0.0000000000000 0.0000000000000</span>
<span class="s2">2 1 1.4332500000000 1.4332500000000 1.4332500000000</span>
<span class="s2">&quot;&quot;&quot;</span>
<span class="n">system</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="s1">&#39;atom_data&#39;</span><span class="p">,</span> <span class="n">bccFe</span><span class="p">,</span> <span class="n">symbols</span><span class="o">=</span><span class="s1">&#39;Fe&#39;</span><span class="p">)</span>

<span class="n">info</span> <span class="o">=</span> <span class="n">system</span><span class="o">.</span><span class="n">dump</span><span class="p">(</span><span class="s1">&#39;atom_data&#39;</span><span class="p">,</span> <span class="n">f</span><span class="o">=</span><span class="s1">&#39;bccFe.dat&#39;</span><span class="p">)</span>

<span class="c1"># Show created file is identical to original content</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s1">&#39;bccFe.dat&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
    <span class="nb">print</span><span class="p">(</span><span class="n">f</span><span class="o">.</span><span class="n">read</span><span class="p">())</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>

2 atoms
1 atom types
0.0000000000000 2.8665000000000 xlo xhi
0.0000000000000 2.8665000000000 ylo yhi
0.0000000000000 2.8665000000000 zlo zhi

Atoms # atomic

1 1 0.0000000000000 0.0000000000000 0.0000000000000
2 1 1.4332500000000 1.4332500000000 1.4332500000000

</pre></div></div>
</div>
<p>The returned info contains LAMMPS input command lines associated with reading the file in.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[8]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="nb">print</span><span class="p">(</span><span class="n">info</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
# Script and atom data file prepared using atomman Python package

units None
atom_style None

boundary p p p
read_data bccFe.dat

</pre></div></div>
</div>
</div>
<div class="section" id="3.2.-Manual-modifications">
<h3>3.2. Manual modifications<a class="headerlink" href="#3.2.-Manual-modifications" title="Permalink to this headline">¶</a></h3>
<p>Now, we’ll dump the same system but change natypes, units, and atom_style parameters.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[9]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># atom_style=&#39;charge&#39; requires per-atom property charge to be set</span>
<span class="n">system</span><span class="o">.</span><span class="n">atoms</span><span class="o">.</span><span class="n">charge</span> <span class="o">=</span> <span class="mi">0</span>

<span class="c1"># units=&#39;nano&#39; will return pos in nm instead of Angstroms</span>
<span class="c1"># natypes=2 only changes the atom types header</span>
<span class="n">info</span> <span class="o">=</span> <span class="n">system</span><span class="o">.</span><span class="n">dump</span><span class="p">(</span><span class="s1">&#39;atom_data&#39;</span><span class="p">,</span> <span class="n">f</span><span class="o">=</span><span class="s1">&#39;bccFe.dat&#39;</span><span class="p">,</span> <span class="n">units</span><span class="o">=</span><span class="s1">&#39;nano&#39;</span><span class="p">,</span> <span class="n">natypes</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">atom_style</span><span class="o">=</span><span class="s1">&#39;charge&#39;</span><span class="p">)</span>

<span class="c1"># Show created file with specified changes</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s1">&#39;bccFe.dat&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
    <span class="nb">print</span><span class="p">(</span><span class="n">f</span><span class="o">.</span><span class="n">read</span><span class="p">())</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>

2 atoms
2 atom types
0.0000000000000 0.2866500000000 xlo xhi
0.0000000000000 0.2866500000000 ylo yhi
0.0000000000000 0.2866500000000 zlo zhi

Atoms # charge

1 1 0.0000000000000 0.0000000000000 0.0000000000000 0.0000000000000
2 1 0.0000000000000 0.1433250000000 0.1433250000000 0.1433250000000

</pre></div></div>
</div>
<p>Show info with specified changes</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[10]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="nb">print</span><span class="p">(</span><span class="n">info</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
# Script and atom data file prepared using atomman Python package

units None
atom_style None

boundary p p p
read_data bccFe.dat

</pre></div></div>
</div>
</div>
<div class="section" id="3.3.-Integrated-potential-data-file-handling">
<h3>3.3. Integrated potential-data file handling<a class="headerlink" href="#3.3.-Integrated-potential-data-file-handling" title="Permalink to this headline">¶</a></h3>
<p>The generation of LAMMPS data files and associated input command lines depends on properties of both the atomic configuration and the choice of interatomic potential. To better support this fact, the atom_data dump style supports a more integrated means of generating the content. This is handled by passing dump(‘atom_style’) a Potential object.</p>
<p>Define an example potential with units=‘nano’ and atom_style=‘charge’</p>
<div class="nbinput nblast docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[11]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="n">potential_json_example_1</span> <span class="o">=</span> <span class="s2">&quot;&quot;&quot;{</span>
<span class="s2">    &quot;potential-LAMMPS&quot;: {</span>
<span class="s2">        &quot;key&quot;: &quot;NOKEY&quot;,</span>
<span class="s2">        &quot;id&quot;: &quot;demo-example-1&quot;,</span>
<span class="s2">        &quot;potential&quot;: {</span>
<span class="s2">            &quot;key&quot;: &quot;NOKEY&quot;,</span>
<span class="s2">            &quot;id&quot;: &quot;demo-example&quot; },</span>
<span class="s2">        &quot;units&quot;: &quot;nano&quot;,</span>
<span class="s2">        &quot;atom_style&quot;: &quot;charge&quot;,</span>
<span class="s2">        &quot;atom&quot;: {</span>
<span class="s2">            &quot;element&quot;: &quot;Fe&quot; },</span>
<span class="s2">        &quot;pair_style&quot;: {</span>
<span class="s2">            &quot;type&quot;: &quot;eam/alloy&quot; },</span>
<span class="s2">        &quot;pair_coeff&quot;: {</span>
<span class="s2">            &quot;term&quot;: [</span>
<span class="s2">                {</span>
<span class="s2">                    &quot;file&quot;: &quot;FeDemo.eam.alloy&quot; },</span>
<span class="s2">                {</span>
<span class="s2">                    &quot;symbols&quot;: &quot;True&quot; } ] } } }&quot;&quot;&quot;</span>

<span class="c1"># Load as Potential</span>
<span class="n">potential</span> <span class="o">=</span> <span class="n">lmp</span><span class="o">.</span><span class="n">Potential</span><span class="p">(</span><span class="n">potential_json_example_1</span><span class="p">)</span>
</pre></div>
</div>
</div>
<p>Create data file and info by supplying potential</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[12]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="n">info</span> <span class="o">=</span> <span class="n">system</span><span class="o">.</span><span class="n">dump</span><span class="p">(</span><span class="s1">&#39;atom_data&#39;</span><span class="p">,</span> <span class="n">f</span><span class="o">=</span><span class="s1">&#39;bccFe.dat&#39;</span><span class="p">,</span> <span class="n">potential</span><span class="o">=</span><span class="n">potential</span><span class="p">)</span>

<span class="c1"># Show created file uses settings from potential</span>
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="s1">&#39;bccFe.dat&#39;</span><span class="p">)</span> <span class="k">as</span> <span class="n">f</span><span class="p">:</span>
    <span class="nb">print</span><span class="p">(</span><span class="n">f</span><span class="o">.</span><span class="n">read</span><span class="p">())</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>

2 atoms
1 atom types
0.0000000000000 0.2866500000000 xlo xhi
0.0000000000000 0.2866500000000 ylo yhi
0.0000000000000 0.2866500000000 zlo zhi

Atoms # charge

1 1 0.0000000000000 0.0000000000000 0.0000000000000 0.0000000000000
2 1 0.0000000000000 0.1433250000000 0.1433250000000 0.1433250000000

</pre></div></div>
</div>
<p>The LAMMPS command lines for the potential are now included in the returned info.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[13]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="nb">print</span><span class="p">(</span><span class="n">info</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
units nano
atom_style charge

boundary p p p
read_data bccFe.dat

pair_style eam/alloy
pair_coeff * * FeDemo.eam.alloy Fe
mass 1 55.845


</pre></div></div>
</div>
</div>
<div class="section" id="3.4.-Notes-on-masses">
<h3>3.4. Notes on masses<a class="headerlink" href="#3.4.-Notes-on-masses" title="Permalink to this headline">¶</a></h3>
<p>The Masses section is not included in the generated data file because atomman specifies mass values by creating LAMMPS mass command lines. This allows for default mass values to be defined based on the chosen potential’s symbols/elements. The mass command lines can be obtained using either Potential.pair_style(), or as described in the last section.</p>
<p>The masses that are listed in the generated mass command lines are selected according to the following order of precedence</p>
<ol class="arabic simple">
<li><p>Any values of System.masses that are not None.</p></li>
<li><p>The value of mass specified in a Potential data model for the atom type’s symbol.</p></li>
<li><p>The standard reference mass for the element associated with the atom type’s symbol.</p></li>
</ol>
<p>In the previous example, the mass listed was taken as the standard reference value of Fe: 55.845. Some potentials define specific mass values to use, which can be listed in the data model on a per model basis.</p>
<div class="nbinput nblast docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[14]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># mass now explicitly defined for Fe</span>
<span class="n">potential_json_example_2</span> <span class="o">=</span> <span class="s2">&quot;&quot;&quot;{</span>
<span class="s2">    &quot;potential-LAMMPS&quot;: {</span>
<span class="s2">        &quot;key&quot;: &quot;NOKEY&quot;,</span>
<span class="s2">        &quot;id&quot;: &quot;demo-example-2&quot;,</span>
<span class="s2">        &quot;potential&quot;: {</span>
<span class="s2">            &quot;key&quot;: &quot;NOKEY&quot;,</span>
<span class="s2">            &quot;id&quot;: &quot;demo-example&quot; },</span>
<span class="s2">        &quot;units&quot;: &quot;nano&quot;,</span>
<span class="s2">        &quot;atom_style&quot;: &quot;charge&quot;,</span>
<span class="s2">        &quot;atom&quot;: {</span>
<span class="s2">            &quot;element&quot;: &quot;Fe&quot;,</span>
<span class="s2">            &quot;mass&quot;: 55.85 },</span>
<span class="s2">        &quot;pair_style&quot;: {</span>
<span class="s2">            &quot;type&quot;: &quot;eam/alloy&quot; },</span>
<span class="s2">        &quot;pair_coeff&quot;: {</span>
<span class="s2">            &quot;term&quot;: [</span>
<span class="s2">                {</span>
<span class="s2">                    &quot;file&quot;: &quot;FeDemo.eam.alloy&quot; },</span>
<span class="s2">                {</span>
<span class="s2">                    &quot;symbols&quot;: &quot;True&quot; } ] } } }&quot;&quot;&quot;</span>

<span class="c1"># Load as Potential</span>
<span class="n">potential</span> <span class="o">=</span> <span class="n">lmp</span><span class="o">.</span><span class="n">Potential</span><span class="p">(</span><span class="n">potential_json_example_2</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[15]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Generate data and info</span>
<span class="n">info</span> <span class="o">=</span> <span class="n">system</span><span class="o">.</span><span class="n">dump</span><span class="p">(</span><span class="s1">&#39;atom_data&#39;</span><span class="p">,</span> <span class="n">f</span><span class="o">=</span><span class="s1">&#39;bccFe.dat&#39;</span><span class="p">,</span> <span class="n">potential</span><span class="o">=</span><span class="n">potential</span><span class="p">)</span>

<span class="c1"># Show that mass in info is now 55.85</span>
<span class="nb">print</span><span class="p">(</span><span class="n">info</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
units nano
atom_style charge

boundary p p p
read_data bccFe.dat

pair_style eam/alloy
pair_coeff * * FeDemo.eam.alloy Fe
mass 1 55.85


</pre></div></div>
</div>
<p>Mass values can also be manually overridden by setting system.masses. This is particularly useful for simulations of different isotopes.</p>
<div class="nbinput docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[16]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="c1"># Set mass for Fe-58 isotope</span>
<span class="n">system</span><span class="o">.</span><span class="n">masses</span> <span class="o">=</span> <span class="n">am</span><span class="o">.</span><span class="n">tools</span><span class="o">.</span><span class="n">atomic_mass</span><span class="p">(</span><span class="s1">&#39;Fe-58&#39;</span><span class="p">)</span>

<span class="c1"># Generate data and info</span>
<span class="n">info</span> <span class="o">=</span> <span class="n">system</span><span class="o">.</span><span class="n">dump</span><span class="p">(</span><span class="s1">&#39;atom_data&#39;</span><span class="p">,</span> <span class="n">f</span><span class="o">=</span><span class="s1">&#39;bccFe.dat&#39;</span><span class="p">,</span> <span class="n">potential</span><span class="o">=</span><span class="n">potential</span><span class="p">)</span>

<span class="c1"># Show that mass in info is now 57.93327443</span>
<span class="nb">print</span><span class="p">(</span><span class="n">info</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="nboutput nblast docutils container">
<div class="prompt empty docutils container">
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
units nano
atom_style charge

boundary p p p
read_data bccFe.dat

pair_style eam/alloy
pair_coeff * * FeDemo.eam.alloy Fe
mass 1 57.93327443


</pre></div></div>
</div>
<p><strong>cleanup</strong></p>
<div class="nbinput nblast docutils container">
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[17]:
</pre></div>
</div>
<div class="input_area highlight-ipython3 notranslate"><div class="highlight"><pre>
<span></span><span class="n">os</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="s1">&#39;bccFe.dat&#39;</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Introduction to atomman: LAMMPS data file conversions</a><ul>
<li><a class="reference internal" href="#1.-Introduction">1. Introduction</a></li>
<li><a class="reference internal" href="#2.-atomman.load(‘atom_data’)">2. atomman.load(‘atom_data’)</a><ul>
<li><a class="reference internal" href="#2.1.-Basic-example">2.1. Basic example</a></li>
<li><a class="reference internal" href="#2.2.-Different-atom_styles">2.2. Different atom_styles</a></li>
<li><a class="reference internal" href="#2.3.-Image-flag-handling">2.3. Image flag handling</a></li>
</ul>
</li>
<li><a class="reference internal" href="#3.-System.dump(‘atom_data’)">3. System.dump(‘atom_data’)</a><ul>
<li><a class="reference internal" href="#3.1.-Basic-example">3.1. Basic example</a></li>
<li><a class="reference internal" href="#3.2.-Manual-modifications">3.2. Manual modifications</a></li>
<li><a class="reference internal" href="#3.3.-Integrated-potential-data-file-handling">3.3. Integrated potential-data file handling</a></li>
<li><a class="reference internal" href="#3.4.-Notes-on-masses">3.4. Notes on masses</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="1.4.4._table_conversions.html"
                        title="previous chapter">Introduction to atomman: table conversions</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="1.4.6._LAMMPS_dump_file_conversions.html"
                        title="next chapter">Introduction to atomman: LAMMPS dump file conversions</a></p>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="1.4.6._LAMMPS_dump_file_conversions.html" title="Introduction to atomman: LAMMPS dump file conversions"
             >next</a> |</li>
        <li class="right" >
          <a href="1.4.4._table_conversions.html" title="Introduction to atomman: table conversions"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../index.html">atomman 1.4.0 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="index.html" >Tutorials</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.0.
    </div>
  </body>
</html>